/*
** Lua binding: worldscript
** Generated automatically by tolua++-1.0.92 on Fri Jan 28 22:29:33 2011.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_worldscript_open (lua_State* tolua_S);

#include "lua/lua_pixelworld.hpp"

/* function to release collected object via destructor */
#ifdef __cplusplus

static int tolua_collect_pm3__PIXELWORLD (lua_State* tolua_S)
{
 pm3::PIXELWORLD* self = (pm3::PIXELWORLD*) tolua_tousertype(tolua_S,1,0);
	delete self;
	return 0;
}
#endif


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"pm3::PIXELWORLD");
}

/* method: new of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_new00
static int tolua_worldscript_pm3_WORLD_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELWORLD* tolua_ret = (pm3::PIXELWORLD*)  new pm3::PIXELWORLD();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELWORLD");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_new00_local
static int tolua_worldscript_pm3_WORLD_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELWORLD* tolua_ret = (pm3::PIXELWORLD*)  new pm3::PIXELWORLD();
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"pm3::PIXELWORLD");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: delete of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_delete00
static int tolua_worldscript_pm3_WORLD_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELWORLD* self = (pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
  delete self;
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: next_map of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_next_map00
static int tolua_worldscript_pm3_WORLD_next_map00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELWORLD* self = (pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'next_map'",NULL);
#endif
  {
   bool tolua_ret = (bool)  self->next_map();
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'next_map'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: prev_map of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_prev_map00
static int tolua_worldscript_pm3_WORLD_prev_map00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELWORLD* self = (pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'prev_map'",NULL);
#endif
  {
   bool tolua_ret = (bool)  self->prev_map();
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'prev_map'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: select_map of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_select_map00
static int tolua_worldscript_pm3_WORLD_select_map00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELWORLD* self = (pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
  int i_num = ((int)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'select_map'",NULL);
#endif
  {
   bool tolua_ret = (bool)  self->select_map(i_num);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'select_map'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: get_num_maps of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_get_num_maps00
static int tolua_worldscript_pm3_WORLD_get_num_maps00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"const pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const pm3::PIXELWORLD* self = (const pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_num_maps'",NULL);
#endif
  {
   int tolua_ret = (int)  self->get_num_maps();
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_num_maps'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: get_cur_map of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_get_cur_map00
static int tolua_worldscript_pm3_WORLD_get_cur_map00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"const pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const pm3::PIXELWORLD* self = (const pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_cur_map'",NULL);
#endif
  {
   int tolua_ret = (int)  self->get_cur_map();
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_cur_map'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: add_map of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_add_map00
static int tolua_worldscript_pm3_WORLD_add_map00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELWORLD* self = (pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
  const std::string r_path = ((const std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add_map'",NULL);
#endif
  {
   int tolua_ret = (int)  self->add_map(r_path);
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
   tolua_pushcppstring(tolua_S,(const char*)r_path);
  }
 }
 return 2;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'add_map'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: dump of class  pm3::PIXELWORLD */
#ifndef TOLUA_DISABLE_tolua_worldscript_pm3_WORLD_dump00
static int tolua_worldscript_pm3_WORLD_dump00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"const pm3::PIXELWORLD",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const pm3::PIXELWORLD* self = (const pm3::PIXELWORLD*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'dump'",NULL);
#endif
  {
   self->dump();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'dump'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: pm3::lua::get_world */
#ifndef TOLUA_DISABLE_tolua_worldscript_get_world00
static int tolua_worldscript_get_world00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnoobj(tolua_S,1,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELWORLD* tolua_ret = (pm3::PIXELWORLD*)  pm3::lua::get_world();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELWORLD");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_world'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_worldscript_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  tolua_module(tolua_S,"pm3",0);
  tolua_beginmodule(tolua_S,"pm3");
   #ifdef __cplusplus
   tolua_cclass(tolua_S,"WORLD","pm3::PIXELWORLD","",tolua_collect_pm3__PIXELWORLD);
   #else
   tolua_cclass(tolua_S,"WORLD","pm3::PIXELWORLD","",NULL);
   #endif
   tolua_beginmodule(tolua_S,"WORLD");
    tolua_function(tolua_S,"new",tolua_worldscript_pm3_WORLD_new00);
    tolua_function(tolua_S,"new_local",tolua_worldscript_pm3_WORLD_new00_local);
    tolua_function(tolua_S,".call",tolua_worldscript_pm3_WORLD_new00_local);
    tolua_function(tolua_S,"delete",tolua_worldscript_pm3_WORLD_delete00);
    tolua_function(tolua_S,"next_map",tolua_worldscript_pm3_WORLD_next_map00);
    tolua_function(tolua_S,"prev_map",tolua_worldscript_pm3_WORLD_prev_map00);
    tolua_function(tolua_S,"select_map",tolua_worldscript_pm3_WORLD_select_map00);
    tolua_function(tolua_S,"get_num_maps",tolua_worldscript_pm3_WORLD_get_num_maps00);
    tolua_function(tolua_S,"get_cur_map",tolua_worldscript_pm3_WORLD_get_cur_map00);
    tolua_function(tolua_S,"add_map",tolua_worldscript_pm3_WORLD_add_map00);
    tolua_function(tolua_S,"dump",tolua_worldscript_pm3_WORLD_dump00);
   tolua_endmodule(tolua_S);
  tolua_endmodule(tolua_S);
  tolua_function(tolua_S,"get_world",tolua_worldscript_get_world00);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_worldscript (lua_State* tolua_S) {
 return tolua_worldscript_open(tolua_S);
};
#endif

